feat(website/matchers): add @format location to Location interface#1630
Conversation
Tag the Location interface with @Format location so the Studio can render a purpose-built widget for city/regionCode/country instead of three free text inputs (which are easy to typo silently). No runtime change — matcher logic and expected data shapes are untouched. Existing configured values keep working; falls back to default rendering until a Studio-side widget for `location` lands. Mirrors the equivalent change on decocms/apps-start #84.
Tagging OptionsShould a new tag be published when this PR is merged?
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdded a JSDoc comment block with ChangesLocation interface annotation
Estimated code review effort: 1 (Trivial) | ~2 minutes Related Issues: None mentioned in the provided context. Related PRs: None mentioned in the provided context. Suggested labels: documentation Suggested reviewers: None identified from the provided context. 🐰 A tiny JSDoc, quiet and neat, 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
@format locationon theLocationinterface inwebsite/matchers/location.ts(annotation on the interface itself, not per prop) so the Studio can render a purpose-built widget forcity/regionCode/country.Map.coordinatesalready usesMapWidget(which encodes@format map), so no change needed there.No runtime change — matcher logic and expected data shapes are untouched. Existing configured values keep working; falls back to default rendering until a Studio-side widget for
locationlands.Context
The Location matcher targets users by three free-text fields:
country: ISO 3166-1 alpha-2 (BR,US, ...) — known finite list fromcf-ipcountry.regionCode: subdivision suffix fromcf-region-code(e.g.SPforBR-SP).city: raw city name fromcf-ipcity— encoding-sensitive, matched by string equality.Free-text inputs make it easy to typo values that silently never match. This annotation gives the Studio a hook to render a cohesive picker.
Mirrors the equivalent change on the successor package: decocms/apps-start#84.
Test plan
Locationvalues (city/regionCode/country) round-trip through the CMS admin.Locationfield falls back to default rendering until the Studio-side widget lands (no visible regression yet).🤖 Generated with Claude Code
Summary by cubic
Adds
@format locationto theLocationinterface inwebsite/matchers/location.tsso Studio can render a single location widget forcity,regionCode, andcountry. No runtime changes; existing matcher behavior and saved values remain valid, and the field falls back to default rendering until the Studio widget is available.Written for commit 4a07baa. Summary will update on new commits.
Summary by CodeRabbit